import instance from '@/api/axios'
// 注册
export const zhuce = ( username,password) => {
    return instance({
        method: 'post',
        url: 'http://localhost:12345/api/user/register',
        data: {
            username,
            password
        }
    });
}
// 登录
export const dl = ( username,password) => {
    return instance({
        method: 'post',
        url: 'http://localhost:12345/api/user/login',
        data: {
            username,
            password
        }
    });
}
// 轮播图
export const lbt = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/swiperdata',
       
    });
}
// 导航
export const dh = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
       
    });
}
// 楼层
export const lc = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/home/floordata',
       
    });
}
// 分类
export const fl = () => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/categories',
       
    });
}
// 列表
export const lb = (data) => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/search',
       params:{
        ...data
       }
    });
}
// 详情
export const xq = (goods_id) => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/detail',
       params:{
        goods_id
       }
    });
}
// 搜索
export const ss = (query) => {
    return instance({
        method: 'GET',
        url: 'https://api-hmugo-web.itheima.net/api/public/v1/goods/qsearch',
       params:{
        query
       }
    });
}
